#ifndef _RETRO_PLAYER_GRAPHICBUFFER
#define _RETRO_PLAYER_GRAPHICBUFFER

#include "player.graphic.h"

namespace Retro
{
  namespace Player
  {
    namespace Graphic
    {
      enum GraphicType
      {
        GraphicNone,
        GraphicTexture,
        GraphicFont,
        GraphicGridMap,
        GraphicSpriteMap,
        GraphicSpriteSet,
        GraphicSpriteBuffer,
        GraphicFPSCounter,
      };

      struct StoredGraphic
      {
        IGraphic*     graphic;
        GraphicType   type;
      };

      class NOVTABLE GraphicBuffer
      {
      private:
        Generic::Vector<StoredGraphic, 10> mBuffer;
        Display::DisplayDevice* mDevice;

      public:
        UINT  add(IGraphic* iValue, GraphicType iType);
        VOID  remove(UINT iIndex);
        UINT  getLength()
        {
          return mBuffer.getLength();
        }

        INL IGraphic* operator[](UINT iIndex)
        {
          return mBuffer[iIndex].graphic;
        }

        INL GraphicType getType(UINT iIndex)
        {
          return mBuffer[iIndex].type;
        }

        INL Display::DisplayDevice* getDisplay()
        {
          return mDevice;
        }

        GraphicBuffer(Display::DisplayDevice* iDevice);
        ~GraphicBuffer();
      };
    }
  }
}

#endif
